package edu.tju.insurance;

import java.sql.SQLException;

import java.util.List;

import com.ibatis.sqlmap.client.SqlMapClient;
import com.younker.waf.db.IBatisConfig;


public class IbatisStudentInsuranceDao implements IStudentInsuranceDao{
	protected SqlMapClient sqlMap = IBatisConfig.getSqlMapInstance();



	

	
	public void deleteStudentInsurance(long id) throws SQLException {
		
		sqlMap.delete("deleteStudentInsurance", id);
	}

	
	public List<StudentInsurance> getStudentInsuranceAnd(
			StudentInsurance studentInsurance) throws SQLException {
		
		return sqlMap.queryForList("getStudentInsuranceAnd", studentInsurance);
	}

	
	public StudentInsurance getStudentInsuranceById(long id)
			throws SQLException {
		
		return (StudentInsurance) sqlMap.queryForObject("getStudentInsuranceById", id);
	}

	
	public List<StudentInsurance> getStudentInsuranceOr(
			StudentInsurance studentInsurance) throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	
	public Long insertStudentInsurance(StudentInsurance studentInsurance)
			throws SQLException {
		
		return (Long)sqlMap.insert("insertStudentInsurance", studentInsurance);
	}

	
	public int updateStudentInsurance(StudentInsurance studentInsurance)
			throws SQLException {

		return sqlMap.update("updateStudentInsurance", studentInsurance);
	}

}
